class Enum {
  constructor (value, description, customFields) {
    this.value = value
    this.desc = description

    if (customFields !== undefined) {
      Object.entries(customFields).forEach(entry => {
        this[entry[0]] = entry[1]
      })
    }
  }
}
export default {
  INVENTORY_TYPE: {
    WAITING_LIST: new Enum(1, '刀具类型',
      { icon: 'iconfont icontubiao5-09', type: '刀具', msg: '刀具', url: '', permissionId: 100 }),
    WAITING_REPAIR: new Enum(2, '模具类型',
      { icon: 'iconfont icontubiao5-08', type: '模具', path: 'mould', msg: '模具', url: '-mould', permissionId: 164 }),
    SPARE_PARTS: new Enum(3, '备品备件',
      { icon: 'iconfont iconqita-10', type: '备品', path: 'spare', msg: '备品', url: '-spare', permissionId: 53 })
    // REPAIRING: new Enum(3, '检具类型',
    //   { icon: 'iconfont icontubiao5-06', type: '检具', path: 'fixture', msg: '检具' }),
    // DEVICE_REPAIR_FINISH: new Enum(4, '夹具类型',
    //   { icon: 'iconfont icontubiao5-07', type: '夹具', path: 'inspection', msg: '夹具' }),
    // DEVICE_FINISH: new Enum(5, '其他类型',
    //   { icon: 'iconfont iconqita-10', type: '其他', path: 'other', msg: '物料' })
  },
  INVENTORY_TYPE_NEW: {
    WAITING_LIST: new Enum(1, '刀具类型',
      { icon: 'iconfont icontubiao5-09', type: '刀具', msg: '刀具' }),
    WAITING_REPAIR: new Enum(2, '模具类型',
      { icon: 'iconfont icontubiao5-08', type: '模具', path: 'mould', msg: '模具' })
    // SPARE_PARTS: new Enum(3, '备品备件',
    //   { icon: 'iconfont icontubiao5-08', type: '备件', path: 'spare', msg: '备件' })
    // REPAIRING: new Enum(3, '检具类型',
    //   { icon: 'iconfont icontubiao5-06', type: '检具', path: 'fixture', msg: '检具' }),
    // DEVICE_REPAIR_FINISH: new Enum(4, '夹具类型',
    //   { icon: 'iconfont icontubiao5-07', type: '夹具', path: 'inspection', msg: '夹具' }),
    // DEVICE_FINISH: new Enum(5, '其他类型',
    //   { icon: 'iconfont iconqita-10', type: '其他', path: 'other', msg: '物料' })
  },
  // 1:整刀报废, 2:刀刃报废
  SCRAPTYPE: {
    WHOLE_SCRAP: new Enum(1, '整刀报废'),
    BLADE_SCRAP: new Enum(2, '刀刃报废')
  },
  // 刀具申请状态
  // 1:待审核, 2:已审核, 3:驳回
  APPLICATION_STATUS: {
    // 待审核
    NEW_STATUS: new Enum(1, '待审核', { color: '#5F77FD' }),
    // 已审核
    CHECKED_STATUS: new Enum(2, '已审核', { color: '#F7B82D' }),
    // 驳回
    REJECT_STATUS: new Enum(3, '驳回', { color: '#E43434' })
  },
  // 入库状态
  INTRODUCTION_STATUS: {
    // 新建
    NEW_STATUS: new Enum(1, '新建', { color: '#5F77FD' }),
    // 入库
    ENTRANT_STATUS: new Enum(2, '入库', { color: '#F7B82D' })
  },
  // 出库状态
  RETRIEVAL_STATUS: {
    // 新建
    NEW_STATUS: new Enum(1, '新建', { color: '#5F77FD' }),
    // 出库
    REMOVAL_STATUS: new Enum(3, '出库', { color: '#F7B82D' })
  },
  // 调配状态
  INVENTORY_ALLOCATE_STATUS: {
    // 待接单
    WAITING: new Enum(1, '待接单', { color: '#5F77FD', receive: true }),
    // 调配中
    ALLOCATING: new Enum(2, '调配中', { color: '#18D77F', receive: true }),
    // 已配送
    ALLOCATED: new Enum(3, '已配送', { color: '#F7B82D', receive: true }),
    // 关闭
    CLOSED: new Enum(4, '关闭', { color: '#999999' })
  },
  // 借出归还状态
  INVENTORY_REVERT_STATUS: {
    // 未归还
    NOT_REVERT: new Enum(1, '未归还', { color: '#5F77FD' }),
    // 部分归还
    REVERTING: new Enum(2, '部分归还', { color: '#18D77F' }),
    // 已归还
    REVERTED: new Enum(3, '已归还', { color: '#F7B82D' })
  },
  EARLY_WARNING_MODE: {
    TIME_MODE: new Enum(1, '计时'),
    COUNT_MODE: new Enum(2, '计次'),
    NONE_MODE: new Enum(3, '无')
  },
  APPLY_OPTIONS: {
    WEIXIU: new Enum('维修领用', '维修领用'),
    BAOYANG: new Enum('保养领用', '保养领用')
    // OTHER: new Enum('其他', '其他')
  }
}
